package VN.EDU.IMIC.PROJECTLEADER.NGUYENVANDOAN.ARRAYEXCERCISES.EX02;

public class VIEWS {
    public static void main(String[] args) {
        int result1;
        double result2;
        System.out.println("Test averaging array methods");

        // Khởi giá trị mặc định cho Mảng
        int[] arr1 = { 1, 2, 3, 4, 5, 6 };
        double[] arr2 = { 6.0, 4.4, 1.9, 2.9, 3.4, 3.5 };

        // print result
        System.out.println("Array:");
        for (int i : arr1) {
            System.out.print("\t" + i + " ");
        }
        System.out.print("\nAveraging array using method of int array: ");
        CONTROLLERS obj = new CONTROLLERS();
        result1 = obj.average(arr1);

        // result1 = Commons.average(arr1);
        System.out.println(result1);

        System.out.println("\nArray:");
        for (double i : arr2) {
            System.out.print("\t" + i + " ");
        }
        System.out.print("\nAveraging array using method of double array: ");
        result2 = obj.average(arr2);
        System.out.println(result2);
    }
}
